import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path:'/',
    component: ()=>import('../views/login/index.vue')
  },
  {   // 客户管理
    path:'/home',   
    component: ()=>import('../views/home/index.vue'),
    children:[
      {
        path:'clientList',  // 客户列表
        component: ()=>import('../views/clientList/index.vue'),
        meta:{
          name:['客户管理','客户列表'],
          path:['','/clientList']
        }
      },
      {
        path:'clientTree',  // 客户树
        component: ()=>import('../views/clientTree/index.vue'),
        meta:{
          name:['客户管理','客户树'],
          path:['','/clientTree']
        }
      },
      {
        path:'levelManagement',  // 等级管理
        component: ()=>import('../views/levelManagement/index.vue'),
        meta:{
          name:['客户管理','等级管理'],
          path:['','/levelManagement']
        }
      },
      { 
        path:'financeProducts',  // 理财产品
        component: ()=>import('../views/financeProducts/index.vue'),
        meta:{
          name:['客户管理','理财产品'],
          path:['','/financeProducts']
        }
      },
      { 
        path:'rechargeRecord',  // 充值记录
        component: ()=>import('../views/rechargeRecord/index.vue'),
        meta:{
          name:['客户管理','充值记录'],
          path:['','/rechargeRecord']
        }
      },
      { 
        path:'requestWithdrawal',  // 申请提现
        component: ()=>import('../views/requestWithdrawal/index.vue'),
        meta:{
          name:['客户管理','申请提现'],
          path:['','/requestWithdrawal']
        }
      },
      { 
        path:'withdrawalReview',  // 提现复审
        component: ()=>import('../views/withdrawalReview/index.vue'),
        meta:{
          name:['客户管理','提现复审'],
          path:['','/withdrawalReview']
        }
      },  
          //统计分析
      {   
        path:'statisticAnalysis/addandstart',   //新增和启动
        component: ()=>import('../views/addandstart/index.vue'),
        meta:{
          name:['统计分析','新增和启动'],
          path:['','/statisticAnalysis/addandstart']
        }
      },
      {
        path:'statisticAnalysis/activeAnalysis',  //活跃和分析
        component: ()=>import('../views/activeAnalysis/index.vue'),
        meta:{
          name:['统计分析','活跃和分析'],
          path:['','/statisticAnalysis/activeAnalysis']
        }
      },
          //商品管理
      { 
        path:'merchandiseControl/productList',  // 商品列表
        component: ()=>import('../views/productList/index.vue'),
        meta:{
          name:['商品管理','商品列表'],
          path:['','/merchandiseControl/productList']
        }
      },
          //支付管理
      { 
        path:'payment/channel',  // 支付渠道
        component: ()=>import('../views/channel/index.vue'),
        meta:{
          name:['支付管理','支付渠道'],
          path:['','/payment/channel']
        }
      }
    ]
  }
]

const router = new VueRouter({
  //mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
